import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ChannelQuery,ChannelListVO,ChannelProductQuery, ChannelProductListVO,  SaveServiceAgentForm } from './types';
import { LocationQueryValue } from 'vue-router';

/**
 * 代理商查询
 */
export const getAgentList = (query: ChannelQuery): AxiosPromise<ChannelListVO[]> => {
  return request({
    url: '/payment/channel/listConfig',
    method: 'get',
    params:query,
  });
};

/**
 * 查询产品列表
 * @param query
 */
export const productList = (query: ChannelProductQuery): AxiosPromise<ChannelProductListVO[]> => {
  return request({
    url: '/payment/channelProduct/list',
    method: 'get',
    params: query
  });
};

/**
 *  保存设置
 */
export const channelProduct = (data: SaveServiceAgentForm) => {
  return request({
    url: '/payment/channelProduct',
    method: 'post',
    data
  });
};


export default {
  getAgentList,
  productList,
  channelProduct,

};
